翻訳と辞書
Words near each other
・ Bindeshwari Prasad Verma
・ Bindfelde station
・ Bindha railway station
・ Binary star
・ Binary Star (hip hop group)
・ Binary stars in fiction
・ Binary symmetric channel
・ Binary Synchronous Communications
・ Binary system
・ Binary system (disambiguation)
・ Binary tetrahedral group
・ Binary translation
・ Binary tree
・ Binary vector
・ Binary XML
Binary-coded decimal
・ Binary-safe
・ Binary-to-text encoding
・ BINAS
・ Binas
・ Binasal hemianopsia
・ Binasal occlusion
・ Binasco
・ Binasli
・ Binasuan
・ Binat Bibi Mosque
・ Binatape
・ Bination
・ Binatisphinctes
・ Binatlı Yılmaz S.K.


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Binary-coded decimal : ウィキペディア英語版
Binary-coded decimal

In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings of decimal numbers where each decimal digit is represented by a fixed number of bits, usually four or eight. Special bit patterns are sometimes used for a sign or for other indications (e.g., error or overflow).
In byte-oriented systems (i.e. most modern computers), the term ''unpacked'' BCD usually implies a full byte for each digit (often including a sign), whereas ''packed'' BCD typically encodes two decimal digits within a single byte by taking advantage of the fact that four bits are enough to represent the range 0 to 9. The precise 4-bit encoding may vary however, for technical reasons, see Excess-3 for instance. The ten states representing a BCD decimal digit are sometimes called ''tetrades'' (for the nibble typically needed to hold them also known as tetrade) with those don't care-states unused named or ''pseudo-decimal digit'').〔That is, in a standard packed 4-bit representation, there are 16 states (4 bits for 1 digit) with 10 tetrades and 6 pseudo-tetrades, whereas in more densely packed schemes such as Chen-Ho or DPD coding there are less, f.e. only 24 pseudo-tetrades in 1024 states (10 bits for 3 digits).〕
BCD's main virtue is its more accurate representation and rounding of decimal quantities as well as an ease of conversion into human-readable representations, in comparison to binary positional systems. BCD's principal drawbacks are a small increase in the complexity of the circuits needed to implement basic arithmetics and a slightly less dense storage.
BCD was used in many early decimal computers, and is implemented in the instruction set of machines such as the IBM System/360 series and its descendants and Digital's VAX. Although BCD ''per se'' is not as widely used as in the past and is no longer implemented in computers' instruction sets, decimal fixed-point and floating-point formats are still important and continue to be used in financial, commercial, and industrial computing, where subtle conversion and fractional rounding errors that are inherent in floating point binary representations cannot be tolerated.
==Basics==
BCD takes advantage of the fact that any one decimal numeral can be represented by a four bit pattern. The most obvious way of encoding digits is "natural BCD" (NBCD), where each decimal digit is represented by its corresponding four-bit binary value, as shown in the following table. This is also called "8421" encoding.
Other encodings are also used, including so-called "4221" and "7421" — named after the weighting used for the bits — and "excess-3". For example the BCD digit 6, '0110'b in 8421 notation, is '1100'b in 4221 (two encodings are possible), '0110'b in 7421, and '1001'b (6+3=9) in excess-3.
As most computers deal with data in 8-bit bytes, it is possible to use one of the following methods to encode a BCD number:
*Unpacked: each numeral is encoded into one byte, with four bits representing the numeral and the remaining bits having no significance.
*Packed: two numerals are encoded into a single byte, with one numeral in the least significant nibble (bits 0 through 3) and the other numeral in the most significant nibble (bits 4 through 7).
As an example, encoding the decimal number 91 using unpacked BCD results in the following binary pattern of two bytes:
Decimal: 9 1
Binary : 0000 1001 0000 0001
In packed BCD, the same number would fit into a single byte:
Decimal: 9 1
Binary : 1001 0001
Hence the numerical range for one unpacked BCD byte is zero through nine inclusive, whereas the range for one packed BCD is zero through ninety-nine inclusive.
To represent numbers larger than the range of a single byte any number of contiguous bytes may be used.  For example, to represent the decimal number 12345 in packed BCD, using big-endian format, a program would encode as follows:
Decimal: 1 2 3 4 5
Binary : 0000 0001 0010 0011 0100 0101
Note that the most significant nibble of the most significant byte is zero, implying that the number is in actuality 012345.  Also note how packed BCD is more efficient in storage usage as compared to unpacked BCD; encoding the same number (with the leading zero) in unpacked format would consume twice the storage.
Shifting and masking operations are used to pack or unpack a packed BCD digit.  Other logical operations are used to convert a numeral to its equivalent bit pattern or reverse the process.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Binary-coded decimal」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.